
<head th:fragment="headerCss">
    <meta charset="utf-8">
    <title></title>
    <meta content="width=device-width, initial-scale=1.0" name=	"viewport">
    <meta name="keywords" content="2023年中职技能竞赛
聊城、德州、滨州、东营四市联赛
“婴幼儿保育”赛项">
    <meta name="description" content="2023年中职技能竞赛
聊城、德州、滨州、东营四市联赛
“婴幼儿保育”赛项">
    <link rel="stylesheet" href="/js/layui/css/layui.css" >
    <!-- Bootstrap CSS File -->
    <link href="/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/examination/common.css" >
    <link rel="shortcut icon" href="">
    <style type="text/css">
        #butt {
            width: 150px;
            height: 58px;
            font-size: 30px;
            line-height: 58px;
            color: #440000;
            background: #dd8e4f;
            border: 1px solid #ff6600;
            text-align: center;
            cursor: default;
        }
        #box {
            overflow: hidden;
            width: 0;
            height: 0;
        }
        #test {
            width: 100%;
            height: 100%;
            border-style: none;
        }

        #layui-layer1 .layui-layer-btn{
            text-align: center;
        }

        #layui-layer1 .layui-layer-btn .layui-layer-btn0{
            background: #FF6A66;
            color: #fff;
            border: none;
            font-size: 14px;
        }

        #layui-layer1 .layui-layer-btn .layui-layer-btn1{
            background: white;
            border:1px solid #FF6A66;
            font-size: 14px;
        }
        .infoBox {
            background: none !important;
        }
        .signin {
            /*background: url("../../../img/indexlogin.png") no-repeat;*/
            background-size: 100% 100%;
        }

        .resetCss {
            border-radius: 25px !important;
        }

        #name {
            font-size: 30px;
        }
        .resetLoginIn{
            width: 680px
        }
        .start p{
            color: #fff;
        }
        .start .solid::after {
            background: #fff;
        }
        .info {
            width: 95% !important;
            display: flex !important;
            margin: 20px 40px !important;
            justify-content: space-between;
        }
        .window_box {
            width: 100%;
        }
        .resetLoginIn {
            width: 100%;
        }

        #examinationLogoImg {
            display: none; /* 隐藏图片 */
        }
        #examinationLogoImg[src] {
            display: block; /* 显示图片 */
        }
        .layui-layer-btn {
            text-align: center !important;
        }
        .layui-layer-btn .layui-layer-btn0 {
            border-color: #FF5656 !important;
            background-color: #FF5656 !important;
            color: #fff !important;
            font-size: 14px;
        }
        #titleText,#eaxmName,#name{
            /*color: #FB5E58 !important;*/
            text-shadow: 0px 3px 6px rgba(156, 0, 0, 0.10);
        }
        .btnColor{
            display: flex;
            justify-items: center;
            align-items: center;
            box-shadow: 0px 3px 6px 1px rgba(156, 0, 0, 0.10);
            border-radius: 6px 6px 6px 6px;
            color: #FFFFFF;
            padding: 8px 55px;
        }
        .btnColor>.btn{
            color: #FFFFFF;
        }
        #sub{
            width: 100px;
        }
        .img{
            width: 26px;
            height: 26px;
            margin: 11px 11px 0 0;
        }
        .btnColor{
            cursor: pointer;
        }

        .arrow {
            position: relative;
            top: 0;
            left: 15px;
            width: 0;
            height: 0;
            border-top: 10px solid transparent; /* 上边透明 */
            border-bottom: 10px solid transparent; /* 下边透明 */
            border-left: 10px solid white; /* 左边黑色 */
        }
    </style>
</head>
<body class="signin" id="excessiveImage">
<div class="infoBox">
    <div class="info">
        <div class="redlogo" style="display: flex;align-items: center">
            <img id="examinationLogoImg"  style="width: 25%;height: 86px;object-fit: contain;padding-left: 14%" >
            <h1 id="titleText"></h1>
        </div>
        <div class="attributes" >
            <h1 id="roomNumber"></h1>
            <h1 id="seatNumber"></h1>
            <h1 id="name"></h1>
        </div>
    </div>
</div>
<div class="main_content">
    <div class="window_box resetCss">
        <div class="loginIn resetLoginIn">
            <h1 id="eaxmName"></h1>
            <div id="time" class="mar10 tips"></div>

            <div class="start" style="display: none">
                <p>考试开始时间</p>
                <div class="solid"></div>
                <p>考试结束时间</p>
            </div>

            <div class="end" style="display: none">
                <p id="startTime"></p>
                <p id="endTime"></p>
            </div>
            <div class="optimize" >
                <div class="btnColor" onclick="login();" id="loginBtnColor">
                    <input  class="btn btn-block not-allowed" id="sub"  readonly value="开始考试" style="background: none;font-weight: bold;font-size: 25px"/>
                    <div class="arrow"></div>
                </div>
            </div>

        </div>
    </div>
</div>

<div id="lookView" style="display: none;padding: 20px">
    <p id="examNotes"></p>
</div>
<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4" th:src="@{/js/jquery.min.js?v='2.1.4'}"></script>
<script src="/js/plugins/layer/layer.min.js" th:src="@{/js/plugins/layer/layer.min.js}"></script>
<script type="text/javascript" src="/js/webJs/defaultConfig/style.config.js"></script>
<script type="text/javascript">

    document.oncontextmenu=new Function("event.returnValue=false");
    document.onselectstart=new Function("event.returnValue=false");

    //f12、f11禁用
    document.onkeydown = function (e) {
        var ev = window.event || e;
        var code = ev.keyCode || ev.which;
        if (123 || 122 ||  115) {
            if(ev.preventDefault) {
                ev.preventDefault();
            } else {
                ev.keyCode = 0;
                ev.returnValue = false;
            }
        }
    };
    $().ready(function() {
        cteated(101)
        cteated(102)
        cteated(204)
        cteated(205)
        cteated(303)
        cteated(403)
        cteated(402)
    });

    function lookView() {
        layer.open({
            title: '考试须知',
            type: 1,
            area: ['1000px', '600px'],
            fixed: false, //不固定
            maxmin: true,
            content: $("#lookView"),
            end: function () {
            },
            success: function () {
            }
        });
    }
    //倒计时
    $(function () {
        if(window.localStorage){
            var times =JSON.parse(window.localStorage.getItem("times"));
            $('#times').text(times);
            var times1 = times * 60;
            var intro = JSON.parse(window.localStorage.getItem("intro"));
            var info = JSON.parse(window.localStorage.getItem("info"));
            $("#startTime").html(intro.startTime);
            //监督员设置了延时
            if(info.endDate !=undefined){
                $("#endTime").html(info.endDate);
            }else{
                $("#endTime").html(intro.endTime);
            }

            $("#examNotes").html(intro.examNotes);
            $("#name").html("二次加密："+info.num2);
        }else{
            layer.msg("请换浏览器，最佳为谷歌")
        }
        $.ajax({
            url: "/jzApi/examinations/selExaminationPaper",
            type:'POST',
            data:{id:window.localStorage.getItem("cbatchId")},
            success: function (r) {
                $("#eaxmName").html(window.localStorage.getItem("batchName"));
                if(window.localStorage){
                    window.localStorage.setItem("exam",JSON.stringify(r.data));
                }else{
                    layer.msg("请换浏览器，最佳为谷歌")
                }
            }
        });

        $.ajax({
            type: "POST",
            url: "/jzApi/examinations/getNowDateTime",
            data: {},
            success: function (r) {
                //console.log("map =" , r.data.endTime);
                window.localStorage.setItem("nowDate",r);
                countDown();
            }
        });
        function addZero(i) {
            return i < 10 ? "0" + i: i + "";
        }
        function countDown() {

            var nowTime = new Date(window.localStorage.getItem("nowDate").replace(/-/g,"/"));
            window.localStorage.setItem("nowDate",new Date(nowTime.getTime()+1000));
            var endTime = new Date(JSON.parse(window.localStorage.getItem("intro")).startTime.replace(/-/g,"/"));  //考试开始时间
            var leftTime = parseInt((endTime.getTime() - nowTime.getTime()) / 1000);
            // var d = parseInt(lefTtime / (24*60*60))
            var h = parseInt(leftTime / (60 * 60) % 24);
            var m = parseInt(leftTime / 60 % 60);
            var s = parseInt(leftTime % 60);
            // d = addZero(d)
            h = addZero(h);
            m = addZero(m);
            s = addZero(s);
            // document.querySelector("#showtime").innerHTML = '考试倒计时 '+h+'时'+m+'分'+s+'秒';
            console.log(leftTime)
            if (leftTime <= 0) {

            }
            setTimeout(countDown, 1000);
        }
    });
    function login() {
        $.ajax({
            url: "/jzApi/examinations/changeBatchState",
            type:'POST',
            data:{id:window.localStorage.getItem("cbatchId")},
            success: function (r) {
                console.log('r',r)
                if(r.code==0) {
                    $.ajax({
                        url: "/jzApi/examinations/changeState",
                        type:'POST',
                        data:{id:JSON.parse(window.localStorage.getItem("info")).stuSignId},
                        success: function (r) {
                            if(r)
                            {
                                location.href='/examination/exam';
                            }else{
                                location.href='/examination/login5';
                                alert("未知错误，请重新登录！");
                            }
                        }
                    });
                }else if(r.code==1){
                    layer.confirm(r.msg, {
                        btn: ['确定'] //可以无限个按钮
                        ,btn1: function(index, layero){

                        }
                    });
                }else{
                    location.href='/examination/login5';
                    alert("未知错误，请重新登录！");
                }
            }
        });



    }

</script>

</body>





